import { http } from '@/utils/http'
import type { PageData } from '@/types/global'
import type { CouponsItem, ICouponPageParam, IcouponRective } from '@/types/coupon'

export const pageCouponAPI = (data: ICouponPageParam) => {
  return http<PageData<CouponsItem[]>>({
    method: 'POST',
    url: `/sys/app/coupons/appPage`,
    data,
  })
}
export const countAPI = (data: any) => {
  return http<number>({
    method: 'GET',
    url: `/sys/app/coupons/count`,
    data,
  })
}

export const pageCouponAvaiableAPI = (data: ICouponPageParam) => {
  return http<PageData<CouponsItem[]>>({
    method: 'POST',
    url: `/sys/app/coupons/availablePage`,
    data,
  })
}
export const receiveAPI = (data: IcouponRective) => {
  return http({
    method: 'POST',
    url: `/sys/app/coupons/receive`,
    data,
  })
}
